<template>
  <div class="container">
    <DataList
      ref="dataList"
      :propAutoFetchData="true"
      :propNoCheck="true"
      :propSearchFields="['matrName','matrSpec']"
      :propSearchTextAppend="'品名/品规'"
      propUrl="/settlement/dept_oprt_uses/pageSum"
      showFieldPk="id"
      :isOnlyShow="true"
      :showFieldList="cpShowFieldList"
      :showDataFmtFun="showDataFmtFun"
    >
    </DataList>
  </div>
</template>

<script>

export default {
  help: '高值消耗-列表',
  data() {
    return {
    }
  },
  methods: {
    showDataFmtFun(data) {
      let index = 1
      data.forEach(item => {
        item.id = index
        index ++
      })
      return data
    }
  },
  computed: {
    cpShowFieldList() {
      let fieldList = [
        { label: '品名', name: 'matrName', span: 12, isTitle: true,sortDisabled: true },
        { label: '品规', name: 'matrSpec', span: 12,isTitleSub: true,sortDisabled: true },
        { label: '数量', name: 'skuQty', span: 12,filterDisabled: true,sortDisabled: true },
        { label: '金额', name: 'amount', span: 12,filterDisabled: true,sortDisabled: true },
        { label: '厂商', name: 'mfgName', span: 24,sortDisabled: true },
        {label:'消耗日期',name:'busDate',span:24,queryType: this.constCommon.formItemType.datePickerBetween.name,showDisabled: true,sortDisabled: true,},
      ]
      fieldList = [...fieldList, ...this.constCommon.filterCommon.spAndHp()]
      fieldList[fieldList.length -1].sortDisabled = true
      fieldList[fieldList.length -2].sortDisabled = true
      return fieldList
    }
  }
}
</script>
